//
//  DatePikerView.m
//  WE
//
//  Created by apple on 15/12/3.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "DatePikerView.h"
#import "Size.h"

@implementation DatePikerView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.datePicker = [[UIDatePicker alloc] init];
        self.datePicker.frame = CGRectMake(0, 0,WindowWidth, self.frame.size.height - 50);
        self.datePicker.datePickerMode = UIDatePickerModeDate;
        [self addSubview:self.datePicker];
        self.cancleButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.cancleButton.frame = CGRectMake(frame.size.width / 6, frame.size.height-50, frame.size.width/4, 40);
        [self.cancleButton setTitle:@"取消" forState:UIControlStateNormal];
        self.cancleButton.backgroundColor = [UIColor greenColor];
        [self.cancleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self addSubview:self.cancleButton];
        
        self.confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.confirmButton.frame = CGRectMake(frame.size.width / 3 + frame.size.width/4, frame.size.height-50, frame.size.width/4, 40);
        [self.confirmButton setTitle:@"确定" forState:UIControlStateNormal];
        self.confirmButton.backgroundColor = [UIColor greenColor];
        [self.confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self addSubview:self.confirmButton];
        
    }
    return self;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
